<?php
/**
 * IG_Console
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: Console.php 524 2011-05-24 01:44:20Z mmxie $
 */
class IG_Console
{
    public function open()
    {
        self::start();
    }

    public function close()
    {
        self::end();
    }

    public static function start()
    {
        if (ob_get_level() == 0) ob_start();
    }

    public static function end()
    {
        ob_end_flush();
    }

    public static function write($str)
    {
        echo $str;
        ob_flush();
        flush();
    }
}